package com.acwing.lc.part1;

/**
 * @author rkc
 * @date 2022/9/11 10:01
 */
public class LC26删除有序数组中的重复项 {

    public int removeDuplicates(int[] nums) {
        int size = 0;
        for (int i = 0; i < nums.length; i++) {
            if (i == 0 || nums[i] != nums[i - 1]) {
                nums[size++] = nums[i];
            }
        }
        return size;
    }
}
